<template>
  <div>
    <template v-for="(sub, index) in items">
      <b-link v-if=" sub.linkType !== 'noLink' " :key="index" :to="{ path: '/' + sub.linkType, query: { id: sub.link } }">
        <b-img v-if="sub.valueType === 'image'" :src=" sub.value " style="width: 100%;margin-top: 3px" />
        <div v-else style="max-width: 100%;margin-top: 3px">
          {{ sub.value }}
        </div>
      </b-link>
      <div v-else :key="index">
        <b-img v-if="sub.valueType === 'image'" :src=" sub.value " style="width: 100%;margin-top: 3px" />
        <div v-else style="max-width: 100%;margin-top: 3px">
          {{ sub.name }}: {{ sub.value }}
        </div>
      </div>
    </template>
  </div>
</template>

<script>

import { getEditData } from '@/api/basicConfig/index'

export default {
  name: 'ConfigGroupShow',
  props: {
    configId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      items: []
    }
  },
  created() {
    getEditData(this.configId).then(res => {
      this.items = res.data.basicItems
    })
  }
}
</script>

<style scoped>
.side-block {
  margin: 5px;
}
</style>
